package com.southminority.ethnic.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.southminority.ethnic.column.ExcelColumn;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 非遗项目实体类
 * 对应数据库表 heritage
 * 
 * @author SouthMinority
 */
@Data
@TableName("heritage")
public class Heritage implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelColumn(name = "非遗ID", columnWidth = 10, value = "1", hidden = true)
    private Long id;

    /**
     * 项目名称
     */
    @TableField("name")
    @ExcelColumn(name = "项目名称", columnWidth = 25, nonNull = true, value = "示例非遗项目")
    private String title;

    /**
     * 非遗类型
     */
    @ExcelColumn(name = "非遗类型", columnWidth = 15, value = "传统技艺", nonNull = true)
    private String heritageType;

    /**
     * 级别
     */
    @ExcelColumn(name = "级别", columnWidth = 12, value = "省级", nonNull = true)
    private String level;

    /**
     * 批准文号
     */
    @ExcelColumn(name = "批准文号", columnWidth = 20, value = "批文字[2024]001", nonNull = true)
    private String approvalNumber;

    /**
     * 批准日期
     */
    @ExcelColumn(name = "批准日期", columnWidth = 18, value = "2024/01/01 00:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date approvalDate;

    /**
     * 所属地区
     */
    @ExcelColumn(name = "地区", columnWidth = 15, value = "贵州", nonNull = true)
    private String region;

    /**
     * 所属民族
     */
    @ExcelColumn(name = "民族", columnWidth = 12, value = "苗族", nonNull = true)
    private String ethnicGroup;

    /**
     * 项目简介
     */
    @ExcelColumn(name = "项目简介", columnWidth = 40, value = "简介示例", nonNull = true)
    private String description;

    /**
     * 历史背景
     */
    @ExcelColumn(name = "历史背景", columnWidth = 40, value = "历史背景示例", hidden = true)
    private String historicalBackground;

    /**
     * 文化价值
     */
    @ExcelColumn(name = "文化价值", columnWidth = 40, value = "文化价值示例", hidden = true)
    private String culturalValue;

    /**
     * 现状
     */
    @ExcelColumn(name = "现状", columnWidth = 30, value = "现状示例", hidden = true)
    private String currentStatus;

    /**
     * 保护措施
     */
    @ExcelColumn(name = "保护措施", columnWidth = 40, value = "保护措施示例", hidden = true)
    private String protectionMeasures;

    /**
     * 传承方式
     */
    @ExcelColumn(name = "传承方式", columnWidth = 30, value = "口传心授", hidden = true)
    private String transmissionMethods;

    /**
     * 主要特征
     */
    @ExcelColumn(name = "主要特征", columnWidth = 30, value = "特征示例", hidden = true)
    private String mainFeatures;

    /**
     * 相关习俗
     */
    @ExcelColumn(name = "相关习俗", columnWidth = 30, value = "习俗示例", hidden = true)
    private String relatedCustoms;

    /**
     * 关键词
     */
    @ExcelColumn(name = "关键词", columnWidth = 20, value = "非遗;民族")
    private String keywords;

    /**
     * 标签
     */
    @ExcelColumn(name = "标签", columnWidth = 20, value = "文化;传统")
    private String tags;

    /**
     * 封面图片
     */
    @ExcelColumn(name = "封面URL", columnWidth = 40, value = "https://example.com/heritage.png")
    private String coverImage;

    /**
     * 相关图片URL列表，JSON格式
     */
    @ExcelColumn(name = "图片URLs(JSON)", columnWidth = 40, value = "['https://example.com/a.png']")
    private String imageUrls;

    /**
     * 相关视频URL列表，JSON格式
     */
    @ExcelColumn(name = "视频URLs(JSON)", columnWidth = 40, value = "['https://example.com/a.mp4']")
    private String videoUrls;

    /**
     * 相关音频URL列表，JSON格式
     */
    @ExcelColumn(name = "音频URLs(JSON)", columnWidth = 40, value = "['https://example.com/a.mp3']")
    private String audioUrls;

    /**
     * 浏览次数
     */
    @ExcelColumn(name = "浏览次数", columnWidth = 12, value = "0", hidden = true)
    private Integer viewCount;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @ExcelColumn(name = "创建时间", columnWidth = 25, hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelColumn(name = "更新时间", columnWidth = 25, hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    /**
     * 状态：1-启用，0-禁用
     */
    @ExcelColumn(name = "状态(1启用/0禁用)", columnWidth = 15, value = "1", hidden = true)
    private Integer status;
} 
